var basecode;
basecode= new Array();
<% for basecode in @basecode -%>
  basecode.push(new Array('<%= basecode.Code %>', '<%= basecode.Name %>', '<%= basecode.EName %>', '<%= basecode.Alias %>', '<%= basecode.Descriprion %>', '<%= basecode.InUse %>', '<%= basecode.CodeLevel %>', '<%= basecode.ParentCode %>', '<%= basecode.Type %>' ));
<% end -%>


function onChange(event){

    var ParentCode;
    ParentCode = $('Parent_Code').value;
    if (ParentCode.length >= 0 ){alert(ParentCode);} else {}

}

document.observe('dom:loaded', function() {
	onChange();
	$('Parent_Code').observe('change', onChange);
});